package cn.qayy.service;


import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;

import cn.qayy.dto.BasisDTO;
import cn.qayy.po.Basis;

/**
 * @author wangyu
 * 基础库接口
 */
@SuppressWarnings("all")
public interface IBasisService extends BasicService{
	/***
	 * 分页查询
	 * @param params
	 * @return
	 */
    PageInfo<Basis> selectForList(Map<String, Object> params) throws Exception;

    List<BasisDTO> selectBasisForDown(@RequestParam Map<String, Object> params) throws Exception;
    /**
     * 通过id 查询基础库
     * @param params
     * @return
     */
    Basis selectByID(@RequestParam Integer id) throws Exception;

    /***
     * 查询基础库各字段拼接的key，用于去重复项时判断
     * @return
     */
    List<? extends String> selectBasicKeys() throws Exception;
    /***
     * 查询基础库所有的省份、地市、区县
     * @return key:字段名，value：对应的数据
     */
	List<? extends Map<String, String>> selectAllProvincesAndCityAndCountry() throws Exception;
	/***
	 * 基础库同步更新注册库
	 * params里存放
	 * provinces 省份集合
	 * citys 地市集合
	 * countrys 区县集合
	 * @return 是否更新成功
	 */
	void updateByPCC(Map<String, Object> params) throws Exception;

	/**
	 * 通过经理查询其在基础库对应的省份
	 * @return
	 * @throws Exception
	 */
	List<String> selectProvinceByMgr(String mgr) throws Exception;

	List<Basis> selectByMap(Map<String, Object> params);
	/**
	 * 查询id
	 * @param params
	 * @return
	 */
	List<Integer> selectIdsByMap(Map<String, Object> params);
	/***
	 * 根据经理，查询该经理负责省份的下面的所有经理
	 * @param user_name
	 * @return
	 */
	List<String> selectMgrOfProvinceByMgr(Map<String, Object> params);
	
	String selectSpaceByMgr(String params) ;

	/***
	 * 持久化操作
	 * @param map
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	void persistence(Map<String, List<Uploadable>> map,HttpServletRequest request,HttpServletResponse response) throws Exception;
	
	
}
